#include <fstream>

#include "data_struct/base/TimeWorkBase/time/InExecution.h"

namespace behavior_controller
{

    int64_t InExecution::start_timestamp_(0);

    InExecution::InExecution()
    {
        std::ifstream st_f;
        st_f.open("/tmp/start_time", std::ios::in);
        st_f >> start_timestamp_;
        st_f.close();
    }

    const InExecution &InExecution::Ref()
    {
        static InExecution ref;
        return ref;
    }

    int64_t InExecution::GetTimestamp() const
    {
        return start_timestamp_ + Clock::NowTimestamp();
    }

    int InExecution::GetTimeNumber() const { return GetTimestamp() / interval; }

} // namespace behavior_controller